/**
 * @ClassName Yacht
 * @Description TODO
 * @Author Quentin_zyj
 * @Date 2021/11/2 15:08
 */
public class Yacht {

    public static void yacht(int f[][], int n) {
        for (int r = 2; r <= n; r++) {
            for (int i = 1; i <= n - r + 1; i++) {
                int j = i + r - 1;
                for (int p = i + 1; p < j; p++) {
                    int temp = f[i][p] + f[p][j];
                    if (f[i][j] > temp) {
                        f[i][j] = temp;
                    }
                }
            }
        }
    }
}
